package bubbleFishBob.game;

import java.util.ResourceBundle;

import bubbleFishBob.gameobjects.AbstractGameObject;
import bubbleFishBob.utilities.reflection.Reflection;

public class GameObjectFactory {

	private final String RESOURCE_FILE = "bubbleFishBob.resources.bubbleFishBob";
	private final ResourceBundle myResourceBundle;

	public GameObjectFactory() {
		myResourceBundle = ResourceBundle.getBundle(RESOURCE_FILE);
	}

	public AbstractGameObject createObject(String object, Object... args) {
		if (myResourceBundle.containsKey(object)) {
			return (AbstractGameObject) Reflection.createInstance(myResourceBundle
					.getString(object), args);
		} else {
			return null;
		}
	}
}
